<template>
  <div>
    <el-dialog :title="formValue.id ? '编辑脚本设置' : '新增脚本设置'" :visible="visible" width="60%" @close="onClose" :close-on-click-modal="false">
      <el-form :model="formValue" ref="formRef" :class="$style.root" :rules="rules">
        <el-row>
          <el-col :span="12">
            <el-form-item label="城市" :label-width="formLabelWidth" prop="city">
              <el-cascader
                v-model="formValue.city"
                :options="cityList"
                :show-all-levels="false"
                placeholder="请选择城市"
                clearable
                filterable
                :props="{ checkStrictly: true }"
              />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="脚本类型" :label-width="formLabelWidth" prop="scriptType">
              <el-input v-model="formValue.scriptType" placeholder="请输入脚本类型" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="脚本内容" :label-width="formLabelWidth" prop="scriptText">
              <el-input type="textarea" :rows="15" v-model="formValue.scriptText" placeholder="请输入脚本内容" clearable></el-input>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" style="text-align: center">
        <el-button @click="onSubmit('formRef')" type="primary" :loading="onSubmitIng">确定</el-button>
        <el-button @click="onClose">取消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<style lang="scss" module>
@import './index.module.scss';
</style>

<script>
import Index from './index';
export default Index;
</script>
